import requests

cookies = {
    'JSESSIONID': '6E8BAE9DFE22722C982578A79A6DB9B0',
    'tempTokenKey': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiLnhormr4UiLCJhdWQiOiI5RTEwNTlDOTMzNUQ0QzdDQjhEQzc0MDBEMDNBRUNGQiIsInNlcnZlciI6Imh0dHBzOi8vZ3ptaC56d2Z3Lmd1aXpob3UuZ292LmNuL2xvZ2luLyIsInJvbGUiOiJST0xFX0FSRUEsUk9MRV9XSU5ET1ciLCJpc0luaXRpYWxQYXNzd29yZCI6IjAiLCJyZWdpb25OYW1lIjoi6LS15bee55yBIiwiaW5kdXN0cnkiOm51bGwsImFwcENvZGUiOiJkZ292LXBvcnRhbCIsIm9yZ2FuTmFtZSI6IuS6keS4iui0teW3niIsInJlZ2lvbkNvZGUiOiI1MjAwMDAiLCJpbmR1c3RyeUxpc3QiOm51bGwsIm9yZ2FuQ29kZSI6IjUyMDAwMiIsImV4cGlyYXRpb25UaW1lIjoyNywiZ3JhZGUiOiIyIiwic3RhdHVzIjoiMSIsImlzcyI6Imluc3B1ciIsImlhdCI6MTczMDEyODAwNywiZXhwIjoxNzMwMTU2ODA3fQ.DFgsXf8OZuZzEa90yFoqEUbywqL95MTzc6IfeVjFKSms3zKh5Egoc-BNAJOPjUK91SX4bRE7ejJI5RqDqCJgOA',
    'userInfoKey': '{^%^22role^%^22:^%^22ROLE_AREA^%^2CROLE_WINDOW^%^22^%^2C^%^22isInitialPassword^%^22:^%^220^%^22^%^2C^%^22regionName^%^22:^%^22^%^E8^%^B4^%^B5^%^E5^%^B7^%^9E^%^E7^%^9C^%^81^%^22^%^2C^%^22appCode^%^22:^%^22dgov-portal^%^22^%^2C^%^22organName^%^22:^%^22^%^E4^%^BA^%^91^%^E4^%^B8^%^8A^%^E8^%^B4^%^B5^%^E5^%^B7^%^9E^%^22^%^2C^%^22regionCode^%^22:^%^22520000^%^22^%^2C^%^22phone^%^22:^%^22384d53fa06a4844cfd54260b048c33e9^%^22^%^2C^%^22organCode^%^22:^%^22520002^%^22^%^2C^%^22expirationTime^%^22:27^%^2C^%^22name^%^22:^%^221342b48e6f8f39ea7ba36accc05b61a8^%^22^%^2C^%^22id^%^22:^%^229E1059C9335D4C7CB8DC7400D03AECFB^%^22^%^2C^%^22email^%^22:^%^22aa67c9bf293c42e9144476195b550c0f^%^22^%^2C^%^22username^%^22:^%^2247d57692a252657367001b6a2ff35333^%^22^%^2C^%^22status^%^22:^%^221^%^22^%^2C^%^22isWeakPwd^%^22:^%^220^%^22}',
    'pwdState': 'true',
    'inspurRoleKey': 'ROLE_AREA',
    'windowId': '0B7CA12E92004E0ABCA9EB88F0A792E4',
    'James_cookie_sYQDUGqqzHtheme': 'custom',
    'webfinal.session.errorCount': '0',
}

headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0',
    'Accept': 'application/json, text/javascript, */*; q=0.01',
    'Accept-Language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2',
    # 'Accept-Encoding': 'gzip, deflate, br, zstd',
    'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
    'X-Requested-With': 'XMLHttpRequest',
    'Origin': 'https://gzmh.zwfw.guizhou.gov.cn',
    'Connection': 'keep-alive',
    'Referer': 'https://gzmh.zwfw.guizhou.gov.cn/zhslzy/accept/system/window/index',
    # 'Cookie': 'JSESSIONID=6E8BAE9DFE22722C982578A79A6DB9B0; tempTokenKey=eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiLnhormr4UiLCJhdWQiOiI5RTEwNTlDOTMzNUQ0QzdDQjhEQzc0MDBEMDNBRUNGQiIsInNlcnZlciI6Imh0dHBzOi8vZ3ptaC56d2Z3Lmd1aXpob3UuZ292LmNuL2xvZ2luLyIsInJvbGUiOiJST0xFX0FSRUEsUk9MRV9XSU5ET1ciLCJpc0luaXRpYWxQYXNzd29yZCI6IjAiLCJyZWdpb25OYW1lIjoi6LS15bee55yBIiwiaW5kdXN0cnkiOm51bGwsImFwcENvZGUiOiJkZ292LXBvcnRhbCIsIm9yZ2FuTmFtZSI6IuS6keS4iui0teW3niIsInJlZ2lvbkNvZGUiOiI1MjAwMDAiLCJpbmR1c3RyeUxpc3QiOm51bGwsIm9yZ2FuQ29kZSI6IjUyMDAwMiIsImV4cGlyYXRpb25UaW1lIjoyNywiZ3JhZGUiOiIyIiwic3RhdHVzIjoiMSIsImlzcyI6Imluc3B1ciIsImlhdCI6MTczMDEyODAwNywiZXhwIjoxNzMwMTU2ODA3fQ.DFgsXf8OZuZzEa90yFoqEUbywqL95MTzc6IfeVjFKSms3zKh5Egoc-BNAJOPjUK91SX4bRE7ejJI5RqDqCJgOA; userInfoKey={^%^22role^%^22:^%^22ROLE_AREA^%^2CROLE_WINDOW^%^22^%^2C^%^22isInitialPassword^%^22:^%^220^%^22^%^2C^%^22regionName^%^22:^%^22^%^E8^%^B4^%^B5^%^E5^%^B7^%^9E^%^E7^%^9C^%^81^%^22^%^2C^%^22appCode^%^22:^%^22dgov-portal^%^22^%^2C^%^22organName^%^22:^%^22^%^E4^%^BA^%^91^%^E4^%^B8^%^8A^%^E8^%^B4^%^B5^%^E5^%^B7^%^9E^%^22^%^2C^%^22regionCode^%^22:^%^22520000^%^22^%^2C^%^22phone^%^22:^%^22384d53fa06a4844cfd54260b048c33e9^%^22^%^2C^%^22organCode^%^22:^%^22520002^%^22^%^2C^%^22expirationTime^%^22:27^%^2C^%^22name^%^22:^%^221342b48e6f8f39ea7ba36accc05b61a8^%^22^%^2C^%^22id^%^22:^%^229E1059C9335D4C7CB8DC7400D03AECFB^%^22^%^2C^%^22email^%^22:^%^22aa67c9bf293c42e9144476195b550c0f^%^22^%^2C^%^22username^%^22:^%^2247d57692a252657367001b6a2ff35333^%^22^%^2C^%^22status^%^22:^%^221^%^22^%^2C^%^22isWeakPwd^%^22:^%^220^%^22}; pwdState=true; inspurRoleKey=ROLE_AREA; windowId=0B7CA12E92004E0ABCA9EB88F0A792E4; James_cookie_sYQDUGqqzHtheme=custom; webfinal.session.errorCount=0',
    'Sec-Fetch-Dest': 'empty',
    'Sec-Fetch-Mode': 'cors',
    'Sec-Fetch-Site': 'same-origin',
    'Priority': 'u=0',
}

params = {
    'orgCode': '520002',
    'windowId': '97A5F9665614476FA1EB1232456CD89F',
}

data = {
    '_search': 'false',
    'nd': '1730132472139',
    'rows': '99999',
    'page': '1',
    'sidx': 'ITEM_CODE',
    'sord': 'asc',
}

response = requests.post(
    'https://gzmh.zwfw.guizhou.gov.cn/zhslzy/accept/system/window/queryItem',
    params=params,
    cookies=cookies,
    headers=headers,
    data=data,
).json()
list=[]
for i in response['rows']:
    list.append(i['cell']['ITEM_CODE'])
    #print(i['cell']['ITEM_CODE'])
